﻿<%@ Page Language="C#" CodeBehind="ControlHeader.aspx.cs" Inherits="UDS.Inc.ControlHeader" %>

<html>
<head>
  <title>Application Header</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <script language="javascript" type="text/javascript">
//<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function ShowModuleView(ModuleID){
	top.main.location = "ModuleView.asp?ModuleID="+ ModuleID +"";
}

function ComfirmExit(action){
	if(action==1)
	{
		myconfirm = confirm("确实要关闭窗口,退出文档一体化系统吗？");
		if (myconfirm === true){
			top.location.href = "../SubModule/Login/logout.aspx?Action=1";
		}
	}
	if(action==2)
	{
		myconfirm = confirm("确实要重新登陆吗？");
		if (myconfirm === true){
			top.location.href="../SubModule/Login/logout.aspx?Action=2";
		}		
	}
}

function GetLink()
{
  var key = document.getElementById("txtKey");
	var str = key.value;
	if(str!="")
	{
		if(key.value.length==1)
		{		
			if((str.toUpperCase()<="Z" && str.toUpperCase() >= "A") || (str.toUpperCase() <= "9" && str.toUpperCase()>="0"))
				alert("不能查询单个字符！");
			else
				top.main.MainFrame.location= "../SubModule/Query/Listview.aspx?Key=" + key.value + "&amp;Range=15&amp;SearchType=3";				
		}
		else
		{
			top.main.MainFrame.location= "../SubModule/Query/Listview.aspx?Key=" + key.value + "&amp;Range=15&amp;SearchType=3";
		}
	}
	else
	{
		alert("请输入查询关键字！");
	}
}

// update local time
var startTime_server = <%= Utility.GetJSDateValue(DateTime.Now) %>;
var startTime_local = new Date().valueOf();
function Timer()
{
  var to_2_digits = function(v)
  {
    return v<10 ? ('0'+v) : v.toString();
  };
  
  var now_local = new Date().valueOf();
  var now_server = new Date(startTime_server + (now_local - startTime_local));
  
  var s = "";
  s += now_server.getUTCFullYear() + "年";
  s += to_2_digits(now_server.getUTCMonth() + 1) + "月";
  s += to_2_digits(now_server.getUTCDate()) + "日 ";
  s += to_2_digits(now_server.getUTCHours()) + ":";
  s += to_2_digits(now_server.getUTCMinutes()) + ":";
  s += to_2_digits(now_server.getUTCSeconds());
  
  document.getElementById("span_time").innerHTML = s;
}

function GetServerTime(updatespan)
{	
  // update the display time
	setInterval("Timer();", 1000);

	// sync the time with the server.
	setInterval("window.location.href = 'ControlHeader.aspx';", updatespan);
}
  //-->
  </script>
  <uds:Style runat="server" Href="~/Css/mycss1.css" />
</head>
<body onload="GetServerTime(15*60*1000);" style="margin: 0px; color: #fff;">
  <form name="Head">
    <table cellspacing="0" cellpadding="0" width="100%" border="0">
      <tr>
        <td width="502" rowspan="2"><img height="89" src="../Images/head42.jpg" width="502" border="0"></td>
        <td bgcolor="#0051a5" height="41"></td>
      </tr>
      <tr>
        <td background="../Images/head7.jpg" height="48">
          <table height="22" cellspacing="0" cellpadding="0" width="100%" border="0">
            <tr>
              <td class="gbtext" align="center">
                <div id="layer3" style="z-index: 3; position: absolute">
                  <div id="layer7" style="z-index: 4; left: -289px; width: 213px; position: absolute; top: -52px; height: 37px">
                    <table height="30" width="100%" border="0">
                      <tr>
                        <td>
                          <marquee id="sys_bulletin" onmouseover="this.stop()" onmouseout="this.start();" scrollamount="5" direction="left" behavior="scroll" loop="0" runat="server"></marquee>
                        </td>
                      </tr>
                    </table>
                  </div>
                  <div id="layer5" style="z-index: 2; left: 146px; width: 371px; position: absolute; top: -68px; height: 31px">
                    <table height="42" width="100%" border="0">
                      <tr>
                        <td bgcolor="#0051a5"></td>
                        <td valign="top" align="right" width="316" background="../Images/head62.jpg" style="text-align: right; color: #fff; padding: 2px 8px 0 0;"><a href="../SubModule/UnitiveDocument/Index.aspx" target="main">我的桌面</a> | <a href="../SubModule/WorkAttendance/Default.aspx" target="MainFrame">考勤</a> | <a href="../SubModule/UnitiveDocument/Setup/MySetup.aspx" target="MainFrame">密码</a> | <a onclick="ComfirmExit(2)" href="#" target="_self">重新登陆</a> | <a onclick="ComfirmExit(1)" href="#" target="_self">退出</a></td>
                      </tr>
                    </table>
                  </div>
                  <div id="layer4" style="z-index: 2; left: 256px; width: 250px; position: absolute; top: -33px; height: 24px">
                    <table width="100%" bgcolor="#0051a5" border="0">
                      <tr>
                        <td></td>
                        <td align="center" width="63"><a href="../SubModule/Query/Google.aspx" target="MainFrame">全文检索</a></td>
                        <td align="center" width="98"><input id="txtKey" onkeydown="if(event.keyCode == 13) { GetLink();}" style="border-right: #ffffff 1px solid; border-top: #ffffff 1px solid; border-left: #ffffff 1px solid; border-bottom: #ffffff 1px solid" type="text" size="12" name="txtKey" height="12px"></td>
                        <td align="center" width="43"><a style="cursor: pointer;" onclick="GetLink()" target="Main"><img id="IMG1" height="24" src="../images/Udssearchbutton.gif" width="26" border="0"></a></td>
                      </tr>
                    </table>
                  </div>
                  <div id="layer6" style="z-index: 3; left: 348px; width: 160px; position: absolute; top: 6px; height: 15px">
                    <span id="span_time"><%= DateTime.Now.ToString("yyyy年MM月dd日 HH:mm:ss") %></span>
                  </div>
                </div>
              </td>
              <td valign="middle" align="center" width="100">&nbsp;</td>
              <td align="center">&nbsp;</td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
  </form>
</body>
</html>
